package cn.wolfcode.wolf2world.query;

import lombok.Getter;

import java.util.HashMap;
import java.util.Map;

/**
 * @author 杨兴健
 * @Date 2020/8/14 22:07
 */
@Getter
public class QueryType {
    public static final Map<Integer, QueryType> DAY_MAP = new HashMap<>();
    public static final Map<Integer, QueryType> EXPEND_MAP = new HashMap<>();
    public static final Map<Integer, String> ORDER_MAP = new HashMap<>();

    static {
        //dayType数据初始化:
        //"-1">不限
        //"1">3天以下
        //"2">4-7天
        //"3">8-14天
        //"4">15天以上

        DAY_MAP.put(1,new QueryType(0,3));
        DAY_MAP.put(2,new QueryType(4,7));
        DAY_MAP.put(3,new QueryType(8,14));
        DAY_MAP.put(4,new QueryType(15,Integer.MAX_VALUE));

        //preExpend 数据初始化
        //"-1">不限
        //"1">1-999
        //"2">1K-6K
        //"3">6K-20K
        //"4">20K以上
        EXPEND_MAP.put(1,new QueryType(1,999));
        EXPEND_MAP.put(2,new QueryType(1000,6000));
        EXPEND_MAP.put(3,new QueryType(6001,20000));
        EXPEND_MAP.put(4,new QueryType(20001,Integer.MAX_VALUE));

        //orderType 数据初始化
        //"1">最新
        //"2">最热
        ORDER_MAP.put(1,"releaseTime");
        ORDER_MAP.put(2,"viewnum");

    }


    private final Integer min;
    private final Integer max;

    public QueryType(Integer min, Integer max) {
        this.min = min;
        this.max = max;
    }
}
